package com.sc.nft.admin.consume;

import com.sc.nft.entity.dto.SaasTaskBurialPointDTO;
import com.sc.nft.enums.MessageTopic;
import com.sc.nft.helper.MessageQueueHelper;
import com.sc.nft.service.SaasTaskService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@RocketMQMessageListener(topic = MessageTopic.OPEN_ACCOUNT + "${spring.profiles.active}", consumerGroup = MessageTopic.OPEN_ACCOUNT + "${spring.profiles.active}")
@Component
@Slf4j
@RequiredArgsConstructor
public class OpenAccountConsumer implements RocketMQListener<SaasTaskBurialPointDTO> {
    private final SaasTaskService saasTaskService;
    @Override
    public void onMessage(SaasTaskBurialPointDTO message) {
        saasTaskService.templateAnalysis(message);
    }
}
